
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>convrt_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>convrt_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void convrt_c ( SpiceDouble       x,
                   ConstSpiceChar  * in,
                   ConstSpiceChar  * out,
                   SpiceDouble     * y    ) 

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
    Take a measurement X, the units associated with 
    X, and units to which X should be converted; return Y --- 
    the value of the measurement in the output units. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
    CONVERSION, UNITS 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  ------------------------------------------------- 
   x          I   Number representing a measurement in some units. 
   in         I   The units in which x is measured. 
   out        I   Desired units for the measurement. 
   y          O   The measurment in the desired units. 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   x          is a number representing a measurement in the units 
              specified by in. 

   in         represents the units associated with a measurement x. 
              Acceptable units are: 

              Angles:                 &quot;RADIANS&quot; 
                                      &quot;DEGREES&quot; 
                                      &quot;ARCMINUTES&quot; 
                                      &quot;ARCSECONDS&quot; 
                                      &quot;HOURANGLE&quot; 
                                      &quot;MINUTEANGLE&quot; 
                                      &quot;SECONDANGLE&quot; 

              Metric Distances:       &quot;METERS&quot; 
                                      &quot;KM&quot; 
                                      &quot;CM&quot; 
                                      &quot;MM&quot; 

              English Distances:      &quot;FEET&quot; 
                                      &quot;INCHES&quot; 
                                      &quot;YARDS&quot; 
                                      &quot;STATUTE_MILES&quot; 
                                      &quot;NAUTICAL_MILES&quot; 

              Astrometric Distances:  &quot;AU&quot; 
                                      &quot;PARSECS&quot; 
                                      &quot;LIGHTSECS&quot; 
                                      &quot;LIGHTYEARS&quot; julian lightyears 

              Time:                   &quot;SECONDS&quot; 
                                      &quot;MINUTES&quot; 
                                      &quot;HOURS&quot; 
                                      &quot;DAYS&quot; 
                                      &quot;JULIAN_YEARS&quot; 
                                      &quot;TROPICAL_YEARS&quot; 
                                      &quot;YEARS&quot; (same as julian years) 


              The case of the string in is not significant.


   out        represents the units desired for the measurement x. 
              See the description of in. 
 
              The case of the string out is not significant.
              
              </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   y          is the input measurement converted to the desired units. 
 
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1) If the input units, output units, or both input and 
      output units are not recognized, the error 
      SPICE(UNITSNOTREC) is signaled. 

   2) If the units being converted between are incompatible, the 
      error SPICE(INCOMPATIBLEUNITS) is signaled. 
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   This routine converts a measurement x given in units specified by 
   in to the equivalent value y in units specified by out. 

   If a unit is not recognized, an error message is produced that 
   indicates which one was not recognized. 

   If input and output units are incompatible (for example angle 
   and distance units) and error message will be produced stating 
   the requested units and associated types. 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   To convert 1 meter to statute miles and feet you could make the
   calls
   

      <b>convrt_c</b> ( 1.0,   &quot;meters&quot;,        &quot;statute_miles&quot;, &amp;miles ); 
      <b>convrt_c</b> ( miles, &quot;statute_miles&quot;, &quot;feet&quot;,          &amp;feet  ); 

   or 

      <b>convrt_c</b> ( 1.0,   &quot;METERS&quot;,        &quot;STATUTE_MILES&quot;, &amp;miles ); 
      <b>convrt_c</b> ( 1.0,   &quot;METERS&quot;,        &quot;FEET&quot;,          &amp;feet  ); 
 
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   You should make sure that your units are appropriate for the 
   measurement. This routine does not do any checking for over- 
   flow. Something like 

         <b>convrt_c</b> ( 10.0e302, &quot;LIGHTYEARS&quot;, &quot;MM&quot;, &amp;y ); 

   will cause a floating point overflow. 

   Some of the units are not &quot;defined&quot; quantities.  In such a case 
   a best estimate is provided as of the date of the current version 
   of this routine.  Those estimated quantities are: 

      1 AU    --- the astronomical unit  is taken from the JPL 
                  ephemeris DE125.  It is believed to be accurate to 
                  about 40 meters. 

      The tropical year is the time from equinox to equinox.  This 
      varies slightly with time. 

      1 PARSEC --- is dependent upon the value of the astronomical 
                   unit. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   N.J. Bachman    (JPL)
   C.A. Curzon     (JPL) 
   H.A. Neilan     (JPL) 
   W.M. Owen       (JPL) 
   W.L. Taber      (JPL) 
   I.M. Underwood  (JPL) 
   
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
 
   -CSPICE Version 1.0.0, 17-MAY-1999 (NJB)(CAC)(HAN)(WMO)(WLT)(IMU)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   convert units 
 </PRE>
<h4>Link to routine convrt_c source file <a href='../../../src/cspice/convrt_c.c'>convrt_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:20 2010</pre>

</body>
</html>

